

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>表单组合</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__STATIC__/layuikn/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="__STATIC__/layuikn/style/admin.css" media="all">
</head>

<style>
    #option_jibing .layui-form-checkbox{
        margin-bottom: 10px;
    }
    .layui-form-radio{
        margin: 0;
    }
    .layui-form-label{
        /*width: 180px;*/
    }
    .layui-input:disabled{
        background: rgb(248,248,248);
    }
</style>

<body>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header"><h2>NRS2002</h2></div>
        <div class="layui-card-body" style="padding: 15px;">
            <fieldset class="layui-elem-field" style="padding: 20px;">
                <legend style="font-size: 15px;">个人信息</legend>
                <div class="layui-row">
                    <div class="layui-col-md3">姓名：<span id="huanzhe_name"></span></div>
                    <div class="layui-col-md3">性别：<span id="huanzhe_gender"></span></div>
                    <div class="layui-col-md3">年龄：<span id="huanzhe_age"></span></div>
                    <div class="layui-col-md3">
                        <div class="layui-inline">BMI：</div>
                        <div class="layui-input-inline" style="width: 100px;">
                            <input type="text" name="renticeliang_bmi" class="layui-input" readonly style="width: 100px;height: 30px;">
                        </div>
                        <div class="layui-inline">kg/m2</div>
                    </div>
                </div>
                <div class="layui-row" style="margin-top: 10px;">
                    <div class="layui-col-md3">身高：<span id="shengao"></span></div>
                    <div class="layui-col-md3">
                        <div class="layui-inline">既往体重：</div>
                        <div class="layui-input-inline" style="width: 100px;">
                            <input type="number" id="jiwangtizhong" class="layui-input" style="width: 100px;height: 30px;">
                        </div>
                        <div class="layui-inline">kg</div>
                    </div>
                    <div class="layui-col-md3">
                        <div class="layui-inline">实际体重：</div>
                        <div class="layui-input-inline" style="width: 100px;">
                            <input type="text" id="tizhong" class="layui-input" readonly style="width: 100px;height: 30px;">
                        </div>
                        <div class="layui-inline">kg</div>
                    </div>
                    <div class="layui-col-md3">
                        <div class="layui-inline">体重下降百分比：</div>
                        <div class="layui-input-inline" style="width: 100px;">
                            <input type="text" class="layui-input" id="tjxjbfb" readonly style="width: 100px;height: 30px;">
                        </div>
                        <div class="layui-inline">%</div>
                    </div>
                </div>
            </fieldset>
            <form class="layui-form" action="" lay-filter="nrs2002-form">
                <fieldset class="layui-elem-field" style="padding: 20px;">
                    <legend style="font-size: 15px;">NRS2002</legend>
                    <div class="layui-row">
                        <div class="layui-col-md12">
                            <div style="font-weight: 600;margin-bottom: 10px;">1、疾病营养需要量程度评分</div>
                            <div class="layui-row" style="margin-bottom: 10px;">
                                <input hidden value="" type="text" name="pingfen1" disabled>
                                <div class="layui-col-md2">
                                    评分1分
                                </div>
                                <div class="layui-col-md8" id="option_pingfen1">
                                    <input type="checkbox" name="pingfen1_option" lay-filter="pingfen1" value="1" title="" score="">
                                </div>
                            </div>
                            <div class="layui-row" style="margin-bottom: 10px;">
                                <input hidden value="" type="text" name="pingfen2" disabled>
                                <div class="layui-col-md2">
                                    评分2分
                                </div>
                                <div class="layui-col-md8" id="option_pingfen2">
                                    <input type="checkbox" name="pingfen1_option" lay-filter="option_pingfen2" value="1" title="" score="">
                                </div>
                            </div>
                            <div class="layui-row" style="margin-bottom: 10px;">
                                <input hidden value="" type="text" name="pingfen3" disabled>
                                <div class="layui-col-md2">
                                    评分3分
                                </div>
                                <div class="layui-col-md8" id="option_pingfen3">
                                    <input type="checkbox" name="pingfen1_option" lay-filter="option_pingfen3" value="1" title="" score="">
                                </div>
                            </div>
                            <div class="layui-row">
                                <div class="layui-col-md2" style="font-weight: 600;">
                                    疾病评分
                                </div>
                                <div class="layui-col-md8">
                                    <div class="layui-col-md2">
                                        <input type="radio" checked name="jibingpingfen" lay-filter="jibingpingfen" value="0" title="0分" score="0">
                                    </div>
                                    <div class="layui-col-md2">
                                        <input type="radio" name="jibingpingfen" lay-filter="jibingpingfen" value="1" title="1分" score="1">
                                    </div>
                                    <div class="layui-col-md2">
                                        <input type="radio" name="jibingpingfen" lay-filter="jibingpingfen" value="2" title="2分" score="2">
                                    </div>
                                    <div class="layui-col-md2">
                                        <input type="radio" name="jibingpingfen" lay-filter="jibingpingfen" value="3" title="3分" score="3">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-row">
                        <div class="layui-col-md12">
                            <div style="font-weight: 600;margin-bottom: 10px;">2、营养受损评分(以下三项评分中选最大值)</div>
                            <div class="layui-row">
                                <div class="layui-row" style="margin-bottom: 10px;">
                                    <div class="layui-col-md3">
                                        <span style="margin-right: 10px;">1、人体测量</span>
                                        <span style="margin-right: 10px;">BMI： </span>
                                        <span name="renticeliang_bmi" style="margin-right: 10px;"></span>
                                        <span>kg/m2</span>
                                    </div>
                                    <div class="layui-col-md7" id="option_renticeliang_bmi">
                                        <div>
                                            <input type="radio" name="bmi" lay-filter="bmi" value="3" title="无(0分)" score="0">
                                        </div>
                                        <div>
                                            <input type="radio" name="bmi" lay-filter="bmi" value="3" title="BMI≤18.5(3分)" score="3">
                                        </div>
                                        <div>
                                            <input type="radio" name="bmi" lay-filter="bmi" value="3" title="严重胸水、腹水、水肿者，卧床得不到BMI者，无严重肝、肾功能异常时，用白蛋白值替代。白蛋白<30g/L　(3分)" score="3">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-row">
                                <div class="layui-row" style="margin-bottom: 10px;">
                                    <div class="layui-col-md3">
                                        <span style="margin-right: 10px;">2、体重下降</span>
                                        <span>近期(1-3个月)体重是否下降?</span>
                                    </div>
                                    <div class="layui-col-md7">
                                        <input type="radio" name="tizhongxiajiang" lay-filter="tizhongxiajiang" value="1" title="是">
                                        <input type="radio" name="tizhongxiajiang" lay-filter="tizhongxiajiang" value="0" title="否">
                                    </div>
                                </div>
                                <div class="layui-row" style="margin-bottom: 10px;">
                                    <div class="layui-col-md3">
                                        <span style="margin-left: 20px;">若是体重下降17.00(kg)</span>
                                    </div>
                                    <div class="layui-col-md7" id="option_is_tizhongxiajiang">
                                        <input type="radio" name="is_tizhongxiajiang" lay-filter="is_tizhongxiajiang" value="3" title="是">
                                        <input type="radio" name="is_tizhongxiajiang" lay-filter="is_tizhongxiajiang" value="3" title="否">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-row">
                                <div class="layui-row" style="margin-bottom: 10px;">
                                    <div class="layui-col-md3">
                                        <span style="margin-right: 10px;">3、摄食下降</span>
                                        <span>一周内进食量是否减少</span>
                                    </div>
                                    <div class="layui-col-md7">
                                        <input type="radio" name="sheshixiajiang" lay-filter="sheshixiajiang" value="1" title="是">
                                        <input type="radio" name="sheshixiajiang" lay-filter="sheshixiajiang" value="0" title="否">
                                    </div>
                                </div>
                                <div class="layui-row" style="margin-bottom: 10px;">
                                    <div class="layui-col-md3">
                                        <span style="margin-left: 20px;">较从前减少</span>
                                    </div>
                                    <div class="layui-col-md7" id="option_is_sheshixiajiang">
                                        <input type="radio" name="is_sheshixiajiang" lay-filter="is_sheshixiajiang" value="3" title="是">
                                        <input type="radio" name="is_sheshixiajiang" lay-filter="is_sheshixiajiang" value="3" title="否">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-row">
                                <div class="layui-row" style="margin-bottom: 10px;">
                                    <div class="layui-col-md3">
                                        <span style="margin-right: 10px;font-weight: 600;">营养评分</span>
                                    </div>
                                    <div class="layui-col-md7">
                                        <input type="radio" name="yingyangfen" lay-filter="yingyangfen" value="0" title="0分，没有受损" score="0">
                                        <input type="radio" name="yingyangfen" lay-filter="yingyangfen" value="1" title="1分，轻度受损" score="1">
                                        <input type="radio" name="yingyangfen" lay-filter="yingyangfen" value="2" title="2分，中度受损" score="2">
                                        <input type="radio" name="yingyangfen" lay-filter="yingyangfen" value="3" title="3分，重度受损" score="3">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-row">
                        <div class="layui-col-md12">
                            <div class="layui-col-md3" style="font-weight: 600;margin-bottom: 10px;">3、年龄是否≥70岁</div>
                            <div class="layui-col-md7">
                                <input type="radio" name="age" lay-filter="age" checked value="0" title="＜70岁(0分)" score="0">
                                <input type="radio" name="age" lay-filter="age" value="1" title="≥70岁(1分)" score="1">
                            </div>
                        </div>
                    </div>
                </fieldset>
                <fieldset class="layui-elem-field" style="padding: 20px;">
                    <legend style="font-size: 15px;">NRS总评分</legend>
                    <div class="layui-form-item">
                        <button class="layui-btn layui-input-inline" id="total_score_btn" style="width: 92px;padding: 0;" lay-submit="" lay-filter="total_score">NRS总评分</button>
                        <div class="layui-input-inline" style="width: 40px;">
                            <input type="text" name="pingfen" placeholder="" readonly class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux" style="display: none;color: #009688!important;" id="total_score_text">分,患者具有营养风险,应开始制定营养治疗计划(包括治疗膳食,经口营养补充,肠内营养及肠外营养)。</div>
                    </div>
                </fieldset>
                <div class="layui-form-item layui-layout-admin">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0;">
                            <button class="layui-btn" lay-submit="" lay-filter="last">上一步</button>
                            <button class="layui-btn" lay-submit="" lay-filter="next">下一步</button>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>

</div>


<script src="__STATIC__/layuikn/layui/layui.js"></script>
<script>
    layui.config({
        base: '__STATIC__/layuikn/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
        ,ajaxData:'../extends/ajaxData'
        ,getOption:'../extends/getOption'
    }).use(['index', 'jquery', 'ajaxData', 'getOption', 'form', 'laydate'], function(){
        var $ = layui.$
            ,admin = layui.admin
            ,element = layui.element
            ,layer = layui.layer
            ,laydate = layui.laydate
            ,ajaxData = layui.ajaxData
            ,getOption = layui.getOption
            ,form = layui.form;

        var pid = sessionStorage.getItem('pid');
        ajaxData.ajaxData('GET',"{:url('patient/info')}?pid=" + pid,{},function (back) {
            if(back.data){
                $('#huanzhe_name').html(back.data.name);
                $('#huanzhe_gender').html(back.data.gender);
                $('#huanzhe_age').html(back.data.age);
                if(back.data.renticeliang !== undefined){
                    $('input[name="renticeliang_bmi"]').val(back.data.renticeliang.bmi);
                    $('span[name="renticeliang_bmi"]').html(back.data.renticeliang.bmi);
                    $('#shengao').html(back.data.renticeliang.shengao);
                    $('#tizhong').val(back.data.renticeliang.tizhong);
                }

            }
        });

        var option_all;


        $.ajax({
            url: "{:url('option/all',[])}",
            type: 'get',
            contentType: 'application/json',
            dataType: 'json',
            async: false, // 同步
            success: function (result) {
                option_all = result;
            }
        });

        var option_pingfen1 =  getOption.option(option_all, '评分1分');
        var option_pingfen2 =  getOption.option(option_all, '评分2分');
        var option_pingfen3 =  getOption.option(option_all, '评分3分');
        var option_renticeliang_bmi =  getOption.option(option_all, '人体测量BMI');
        var option_is_tizhongxiajiang =  getOption.option(option_all, '体重下降--若是体重下降');
        var option_is_sheshixiajiang =  getOption.option(option_all, '摄食下降--较从前减少');

        //评分1分
        var option_pingfen1_html = '';
        $.each(option_pingfen1.children,function (k,v) {
            option_pingfen1_html +=
                '<input type="checkbox" name="pingfen1_option" lay-filter="pingfen1" value="' + v.id + '" title="' + v.name + '" score="' + v.v + '">';
        });
        $('#option_pingfen1').html(option_pingfen1_html);

        //评分2分
        var option_pingfen2_html = '';
        $.each(option_pingfen2.children,function (k,v) {
            option_pingfen2_html +=
                '<input type="checkbox" name="pingfen2_option" lay-filter="pingfen2" value="' + v.id + '" title="' + v.name + '" score="' + v.v + '">';
        });
        $('#option_pingfen2').html(option_pingfen2_html);

        //评分3分
        var option_pingfen3_html = '';
        $.each(option_pingfen3.children,function (k,v) {
            option_pingfen3_html +=
                '<input type="checkbox" name="pingfen3_option" lay-filter="pingfen3" value="' + v.id + '" title="' + v.name + '" score="' + v.v + '">';
        });
        $('#option_pingfen3').html(option_pingfen3_html);

        //人体测量BMI
        var option_renticeliang_bmi_html = '';
        $.each(option_renticeliang_bmi.children,function (k,v) {
            option_renticeliang_bmi_html +=
                ' <div>\n' +
                '     <input type="radio" name="bmi" lay-filter="bmi" value="' + v.id + '" title="' + v.name + '" score="' + v.v + '">\n' +
                '</div>';
        });
        $('#option_renticeliang_bmi').html(option_renticeliang_bmi_html);

        //是体重下降
        var option_is_tizhongxiajiang_html = '';
        $.each(option_is_tizhongxiajiang.children,function (k,v) {
            option_is_tizhongxiajiang_html +=
                '     <input type="radio" name="is_tizhongxiajiang" lay-filter="is_tizhongxiajiang" value="' + v.id + '" title="' + v.name + '" score="' + v.v + '">\n';
        });
        $('#option_is_tizhongxiajiang').html(option_is_tizhongxiajiang_html);

        //是摄食下降
        var option_is_sheshixiajiang_html = '';
        $.each(option_is_sheshixiajiang.children,function (k,v) {
            option_is_sheshixiajiang_html +=
                '     <input type="radio" name="is_sheshixiajiang" lay-filter="is_sheshixiajiang" value="' + v.id + '" title="' + v.name + '" score="' + v.v + '">\n';
        });
        $('#option_is_sheshixiajiang').html(option_is_sheshixiajiang_html);

        form.render();

        //监听复选框
        form.on('checkbox(pingfen1)', function (data) {
            var number = $('input[name="pingfen1"]'), value = data.value, array = number.val().split(",");

            if (data.elem.checked) {
                number.val(number.val() + value + ",");
            } else {
                var newnumber = "";
                for (var i = 0; i < array.length; i++) {
                    var str = array[i];
                    newnumber += (str != value && str != "" && str != null) ? str + "," : "";
                }
                number.val(newnumber);
            }
            jibingzuigaopingfen();
        });

        form.on('checkbox(pingfen2)', function (data) {
            var number = $('input[name="pingfen2"]'), value = data.value, array = number.val().split(",");

            if (data.elem.checked) {
                number.val(number.val() + value + ",");
            } else {
                var newnumber = "";
                for (var i = 0; i < array.length; i++) {
                    var str = array[i];
                    newnumber += (str != value && str != "" && str != null) ? str + "," : "";
                }
                number.val(newnumber);
            }
            jibingzuigaopingfen();
        });

        form.on('checkbox(pingfen3)', function (data) {
            var number = $('input[name="pingfen3"]'), value = data.value, array = number.val().split(",");

            if (data.elem.checked) {
                number.val(number.val() + value + ",");
            } else {
                var newnumber = "";
                for (var i = 0; i < array.length; i++) {
                    var str = array[i];
                    newnumber += (str != value && str != "" && str != null) ? str + "," : "";
                }
                number.val(newnumber);
            }
            jibingzuigaopingfen();
        });

        function initpingfen1Value() {
            var param=$("input[name='pingfen1']").val(),checkBoxs = $("input[type='checkbox']"), array = param.split(",");
            for (var i = 0; i < array.length; i++) {
                for (var j = 0; j < checkBoxs.length; j++) {
                    var checkbox = $(checkBoxs[j]);
                    if (checkbox.val() == array[i]) {
                        checkbox.attr('checked','checked');
                        break;
                    }
                }
            }
            form.render('checkbox');
        }

        function initpingfen2Value() {
            var param=$("input[name='pingfen2']").val(),checkBoxs = $("input[type='checkbox']"), array = param.split(",");
            for (var i = 0; i < array.length; i++) {
                for (var j = 0; j < checkBoxs.length; j++) {
                    var checkbox = $(checkBoxs[j]);
                    if (checkbox.val() == array[i]) {
                        checkbox.attr('checked','checked');
                        break;
                    }
                }
            }
            form.render('checkbox');
        }

        function initpingfen3Value() {
            var param=$("input[name='pingfen3']").val(),checkBoxs = $("input[type='checkbox']"), array = param.split(",");
            for (var i = 0; i < array.length; i++) {
                for (var j = 0; j < checkBoxs.length; j++) {
                    var checkbox = $(checkBoxs[j]);
                    if (checkbox.val() == array[i]) {
                        checkbox.attr('checked','checked');
                        break;
                    }
                }
            }
            form.render('checkbox');
        }

        //疾病评分获取选中最高分值选中对应疾病评分
        function jibingzuigaopingfen(){
            var zuigao = 0;
            $('input[name="pingfen1_option"]').each(function (k,v) {
                if($(this).prop('checked')){
                    zuigao = 1;
                }
            });
            $('input[name="pingfen2_option"]').each(function (k,v) {
                if($(this).prop('checked')){
                    zuigao = 2;
                }
            });
            $('input[name="pingfen3_option"]').each(function (k,v) {
                if($(this).prop('checked')){
                    zuigao = 3;
                }
            });
            if(zuigao == 0){
                $('input[name="jibingpingfen"][value="0"]').prop("checked", true);
            }else if(zuigao == 1){
                $('input[name="jibingpingfen"][value="1"]').prop("checked", true);
            }else if(zuigao == 2){
                $('input[name="jibingpingfen"][value="2"]').prop("checked", true);
            }else if(zuigao == 3){
                $('input[name="jibingpingfen"][value="3"]').prop("checked", true);
            }
            form.render();
            return false;
        }

        //监听单选框
        form.on('radio(tizhongxiajiang)', function (data) {
           if(data.value == 0){
               $('input[name="is_tizhongxiajiang"]').removeAttr('checked');
           }
            yingyangzuigaopingfen();
           form.render();
        });
        form.on('radio(sheshixiajiang)', function (data) {
            if(data.value == 0){
                $('input[name="is_sheshixiajiang"]').removeAttr('checked');
            }
            yingyangzuigaopingfen();
            form.render();
        });

        form.on('radio(bmi)', function (data) {
            yingyangzuigaopingfen();
        });

        form.on('radio(is_tizhongxiajiang)', function (data) {
            yingyangzuigaopingfen();
        });

        form.on('radio(is_sheshixiajiang)', function (data) {
            yingyangzuigaopingfen();
        });

        //营养评分获取选中最高分值选中对应营养评分
        function yingyangzuigaopingfen(){
            var zuigao = 0;
            var bmi = $('input[name="bmi"]:checked').attr('score');
            var is_tizhongxiajiang = $('input[name="is_tizhongxiajiang"]:checked').attr('score');
            var is_sheshixiajiang = $('input[name="is_sheshixiajiang"]:checked').attr('score');
            var array = [];

            if(bmi !== undefined){
                bmi = parseInt(bmi);
                array.push(bmi);
            }
            if(is_tizhongxiajiang !== undefined){
                is_tizhongxiajiang = parseInt(is_tizhongxiajiang);
                array.push(is_tizhongxiajiang);
            }
            if(is_sheshixiajiang !== undefined){
                is_sheshixiajiang = parseInt(is_sheshixiajiang);
                array.push(is_sheshixiajiang);
            }
            if(array.length <= 0){
                $('input[name="yingyangfen"]').removeAttr('checked');
            }
            zuigao = Math.max.apply(null, array);
            $('input[name="yingyangfen"][score="' + zuigao + '"]').prop('checked','checked');
            form.render();
            return false;
        }


        ajaxData.ajaxData('GET',"{:url('nrs2002/info')}?pid=" + pid,{},function (back) {

            if(back.data){
                //给表单赋值
                form.val("nrs2002-form", back.data);
                if(back.data.pingfen != ''){
                    if(back.data.pingfen <= 2){
                        $('#total_score_text').html('分,住院期间每周复查营养筛查。');
                    }else{
                        $('#total_score_text').html('分,患者具有营养风险,应开始制定营养治疗计划(包括治疗膳食,经口营养补充,肠内营养及肠外营养)。');
                    }
                    $('#total_score_text').show();
                }
                $('#jiwangtizhong').val(back.data.jiwangtizhong);
                $('#tjxjbfb').val(back.data.tjxjbfb);
            }
            initpingfen1Value();
            initpingfen2Value();
            initpingfen3Value();
            //form.render();
        });

        $('#jiwangtizhong').blur(function () {
            var tizhong = $('#tizhong').val();
            var jiwangtizhong = $('#jiwangtizhong').val();
            if(tizhong == '' || jiwangtizhong == ''){
                $('#tjxjbfb').val('');
                return false;
            }
            var tjxjbfb = (parseFloat(jiwangtizhong) - parseFloat(tizhong))/tizhong*100;
            tjxjbfb = tjxjbfb.toFixed(2);
            $('#tjxjbfb').val(tjxjbfb);
        });

        form.on('submit(total_score)',function () {
            var jibingpingfen = $('input[name="jibingpingfen"]:checked').attr('score');
            var yingyangfen = $('input[name="yingyangfen"]:checked').attr('score');
            var bmi = $('input[name="bmi"]:checked').attr('score');
            var age = $('input[name="age"]:checked').attr('score');
            if(jibingpingfen == 0){
                layer.msg('请选择疾病营养需要量程度评分项!');
                return  false;
            }

            if(bmi === undefined){
                layer.msg('请选择人体测量  BMI项!');
                return  false;
            }
            var total_score = parseInt(jibingpingfen) + parseInt(yingyangfen) + parseInt(age);
            $('#total_score_text').show();
            if(total_score <= 2){
                $('#total_score_text').html('分,住院期间每周复查营养筛查。');
            }else{
                $('#total_score_text').html('分,患者具有营养风险,应开始制定营养治疗计划(包括治疗膳食,经口营养补充,肠内营养及肠外营养)。');
            }
            $('input[name="pingfen"]').val(total_score);
            return false;
        })

        form.on('submit(last)',function(data){
            if(pid == 'null') return  false;
            window.location.href = "{:url('pgsgayisheng/show')}";
            return  false;
        });

        /* 监听提交 */
        form.on('submit(next)', function(data){
            //console.log(data.field);return  false;
            var jibingpingfen = $('input[name="jibingpingfen"]:checked').attr('score');
            var bmi = $('input[name="bmi"]:checked').attr('score');
            if(jibingpingfen == 0){
                layer.msg('请选择疾病营养需要量程度评分项!');
                return  false;
            }

            if(bmi === undefined){
                layer.msg('请选择人体测量  BMI项!');
                return  false;
            }
            if(pid == 'null') return  false;
            data.field.jiwangtizhong = $('#jiwangtizhong').val();
            data.field.tjxjbfb = $('#tjxjbfb').val();
            ajaxData.ajaxData('POST', "{:url('nrs2002/update')}?pid=" + pid, data.field,function (back) {
                console.log(data.field);
                if(back.code == 200){
                    window.location.href = "{:url('shzl/show')}";
                }else{
                    layer.msg(back.msg, {icon: 5});
                }
            });
            // parent.layer.alert(JSON.stringify(data.field), {
            //     title: '最终的提交信息'
            // })
            return false;
        });

    });
</script>
</body>
</html>
